package com.project.baowei.adapter;

import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.project.baowei.bean.respoes.SelectBean;
import com.wangshen.base.ui.mvp.base.adapter.BaseAdapter;
import com.wangshen.projectbase.R;

import java.util.List;

public class SelectAdapter extends BaseAdapter<SelectBean> {

    public SelectAdapter(int layoutResId, List<SelectBean> data) {
        super(layoutResId, data);

    }

    @Override
    protected void convert(BaseViewHolder helper, SelectBean item) {
        super.convert(helper, item);
        if (item.getIsSelect()){
            helper.setBackgroundColor(R.id.tv_title,getContext().getResources().getColor(R.color.base_color));
            helper.setTextColor(R.id.tv_title,getContext().getResources().getColor(R.color.white));
        }else {
            helper.setBackgroundColor(R.id.tv_title,getContext().getResources().getColor(R.color.white));
            helper.setTextColor(R.id.tv_title,getContext().getResources().getColor(R.color.black));
        }
        helper.setText(R.id.tv_title,item.getName());
    }
}
